package com.example.demo1115.controller;

import com.example.demo1115.dao.UserDao;
import com.example.demo1115.service.UserService;
import com.example.demo1115.vo.LoginVo;
import com.example.demo1115.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
public class LoginController {
    @Autowired
    private UserService userService;
    @PostMapping("login")
    public Result findByusernameandpass(@RequestBody LoginVo loginVo) {
        Result byusernameandpass = userService.findByusernameandpass(loginVo.getUsername(), loginVo.getPassword());
        return byusernameandpass;
    }

}
